<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:tiles="http://tiles.apache.org/tags-tiles"
		  xmlns:sec="http://www.springframework.org/security/tags" xmlns:fmt="http://java.sun.com/jstl/fmt_rt"
		  xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:c="http://java.sun.com/jstl/core_rt"
		  xmlns:ct="urn:jsptagdir:/WEB-INF/tags" xmlns="http://www.w3.org/1999/xhtml" version="2.0">

	<jsp:directive.page contentType="text/html"/>

	<tiles:insertDefinition name="common-template">

		<tiles:putAttribute name="title" type="string" value="Product description - ${product.name}"/>

		<tiles:putAttribute name="content" type="string">
			<div id="categories">
				<ct:categories list="${categories}" level="${0}"/>
			</div>
			<div id="product_description">
				<div id="category_chain">
					<c:choose>
						<c:when test="${!empty categoryChain}">
							<a href="/index.html"><fmt:message key="label.catalog"/></a>
							<c:forEach items="${categoryChain}" var="category" varStatus="s">
								>
								<c:choose>
									<c:when test="${s.index != fn:length(categoryChain)-1}">
										<a href="/index.html?id=${category.key}"><c:out value="${category.name}"/></a>
									</c:when>
									<c:otherwise>
										<i><a href="/index.html?id=${category.key}"><c:out value="${category.name}"/></a></i>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<fmt:message key="label.catalog"/>
						</c:otherwise>
					</c:choose>
				</div>
				<div id="product_main_image">
					<img src="/images/${product.imageName}" class="product_thumbnail"/>
				</div>

				<div id="short_description">
					<c:out value="${product.shortDescription}"></c:out>
				</div>
				<c:out value="${product.name}"></c:out>
			</div>
			<div class="clearing"/>
			<div id="comments">
				<c:choose>
					<c:when test="${!empty comments}">
						<c:forEach items="${comments}" var="comment" varStatus="s">
							<c:out value="${comment.message}"/><br/>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<fmt:message key="label.catalog"/>
					</c:otherwise>
				</c:choose>
			</div>
			<ct:pager params="${pagerData}" id="${product_id}"/>
		</tiles:putAttribute>

	</tiles:insertDefinition>

</jsp:root>